This is an example model run for Vancouver. The chosen year will be 2011. Let's begin with a little CALMET.

Require Statement and Working Directory

Once the PuffR package is installed, make sure to use a require statement whenever you'd like to work with its functions.

require(PuffR)

Now, set a working directory. This is where all of the model inputs and outputs will be located.

setwd("~/Documents/Calpuff")

Let's generate some geophysical input files for CALMET. This will consist of a grid centered on 49.5ºN and 125.30364ºW. The width (E-W distance) of the grid will be 8000 m, and the height (N-S distance) will be the same. We will elect to download SRTM terrain height data from "http://gis-lab.info/data/srtm-tif/".

calmet_define_geophys(lat_dec_deg = 49.250117,
                      lon_dec_deg = -123.076122,
                      lat_lon_grid_loc = 1,
                      domain_width_m = 8000,
                      domain_height_m = 8000,
                      download_SRTM = TRUE)

Now, generate an input file for surface meteorological stations in the domain.

calmet_surface_met(start_year = 2011,
                   end_year = 2011,
                   lat_dec_deg = 49.250117,
                   lon_dec_deg = -123.076122,
                   lat_lon_grid_loc = 1,
                   domain_width_m = 30000,
                   domain_height_m = 30000,
                   time_offset = -8,
                   output_file = "surf.dat")


rich-iannone/PuffR documentation built on May 27, 2019, 7:46 a.m.